{extend name="public/base"/}
{block name="style"}
<link rel="stylesheet" type="text/css" href="__PUBLIC__/writer/style/books.css">
{/block}
{block name="body"}
    {include file="public/topmenu" /}
    {include file="public/changepwd" /}
    <div class="mainWrap pageCenter cf">     
        {include file="public/leftmenu" /}
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/writer/style/income.css">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/writer/style/reader_model.css">

        <div class="mainRight pb260 fl">
        <div class="crumbsWrap"> <i><span>收入管理</span></i> </div>
        <div class="tabSwitch cf">
            <span class="act">
                <a href="{:url('writer/stats/incomemonth')}">总收入</a>
            </span>
            <span >
                <a href="{:url('writer/stats/incomewelfar')}">奖励保障</a>
            </span>
            <span>
                <a href="{:url('writer/stats/incomecopyright')}">版权收入</a>
            </span>
			<span>
                <a href="{:url('writer/stats/incomesubscription')}">订阅明细</a>
            </span>
            <span>
                <a href="{:url('writer/stats/incomerewards')}">打赏明细</a>
            </span>

        </div>
        <div class="incomeWrap">
			<div class="filter-box income cf">
			  <select name="showtype">
					<option value="date" selected="selected">按月份</option>
					<option value="works">按作品</option>
			  </select>
			  <select name="year">
						
					<option value="2018"  {eq name="year" value="2018"}selected="selected"{/eq}>2018</option>
					<option value="2019" {eq name="year" value="2019"}selected="selected"{/eq}>2019</option>
					<option value="2020" {eq name="year" value="2020"}selected="selected"{/eq}>2020</option>
					<option value="2021" {eq name="year" value="2021"}selected="selected"{/eq}>2021</option>
					<option value="2022" {eq name="year" value="2022"}selected="selected"{/eq}>2022</option>
					<option value="2023" {eq name="year" value="2023"}selected="selected"{/eq}>2023</option>
					   
			  </select>
			  <select name="month">
						
						 <option value="1" {eq name="month" value="1"}selected="selected"{/eq}>1</option>    
						 <option value="2" {eq name="month" value="2"}selected="selected"{/eq}>2</option>    
						 <option value="3" {eq name="month" value="3"}selected="selected"{/eq}>3</option>    
						 <option value="4" {eq name="month" value="4"}selected="selected"{/eq}>4</option>
						 <option value="5" {eq name="month" value="5"}selected="selected"{/eq}>5</option>
						  
						 <option value="6" {eq name="month" value="6"}selected="selected"{/eq}>6</option>    
						 <option value="7" {eq name="month" value="7"}selected="selected"{/eq}>7</option>    
						 <option value="8" {eq name="month" value="8"}selected="selected"{/eq}>8</option>    
						 <option value="9" {eq name="month" value="9"}selected="selected"{/eq}>9</option>    
						 <option value="10" {eq name="month" value="10"}selected="selected"{/eq} >10</option>    
						 <option value="11" {eq name="month" value="11"}selected="selected"{/eq}>11</option>    
						 <option value="12" {eq name="month" value="12"}selected="selected"{/eq}>12</option>  
			  </select>
			  <select name="novel"  style="display:none;">
				   {volist name="books" id="vo"}
					<option value="{$vo.id}">{$vo.title}</option>
					{/volist}
			  </select>
			  <a class="button" href="javascript:" id="searchBtn">查看</a>
			</div>
        <div class="reserveChart mb30">
          <h3 class="reserveTitle"> <em class="icon pie"></em>收入分布</h3>
          <div class="chartWrap">
            <h2 id="bookTitle">2018年3月稿酬收入<br></h2>
            <div id="incomeSumBox" class="totalCenter" style="display:none;">
              <table class="totalData" width="100%" border="0" cellspacing="0">
                <tbody>
                  <tr>
                    <td><h3>总收入(元)</h3>
                      <p data-node="sum">0</p>
                      <h4><span data-node="incomeTypeName">签约平台</span>（元）</h4>
                      <div id="incomeDetailBox" class="detailWrap"> <span data-node="detailTotal">0</span><em data-node="detailIcon" class="icon"></em>
                        <div id="incomeDetailBubble" class="detailBubble"> <cite class="icon"></cite>
                          <ul data-node="detailList">
                          </ul>
                        </div>
                      </div></td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div id="noDataBox" class="nodataBox" style=""> <img src="__PUBLIC__/writer/images/nodata.png" width="141" height="154">
              <p>暂无收入</p>
            </div>
            <div class="reserveGraph" id="chartBox" style="display: none;"></div>
          </div>
        </div>
		
        <div class="reserveListWrap">
          <h3 class="reserveTitle"> <em class="icon reward"></em>收入明细 
          <!-- <span class="fr">合计总收入（含稿酬及部分福利）<i id="total"></i>元</span> -->
          </h3>
          <div class="detailWrap mb10">
            <table class="detailTable f12" width="100%" border="0" cellspacing="0">
              <colgroup>
              <col width="13%">
              <col width="9%">
              <col width="10%">
              <col width="7%">
              <col width="8%">
              <col width="8%">
              <col width="8%">
              <col width="8%">
              <col width="9%">
              <col width="9%">
              </colgroup>
              <thead>
                <tr>
                  <th rowspan="2" id="change">作品</th>
                  <th colspan="4">签约平台</th>
                  <th rowspan="2">第三方渠道</th>
                  <th rowspan="2">版权收入</th>
                  <th rowspan="2">支付状态</th>
                  <th class="nobr" rowspan="2">合计</th>          
                </tr>
                <tr>
                  <th>订阅收入</th>
				  <th>包月收入</th>
                  <th>道具收入</th>
                  <th>奖励保障</th>
                  
                </tr>
              </thead>
              <tbody id="incomeList" incometype="month">    <tr>
                <td colspan="14">暂无任何数据</td>
            </tr>
        </tbody>

            </table>
          </div>
            <!-- 翻页容器 -->
          <div id="pager" class="pageBox fr cf"></div>
        </div>
        <div class="gTip cfboth">
        <p>1.签约平台是指作品签约网站所拥有的平台，例如：</p>
        <p> web平台   cps渠道   小程序     app ； </p>        
        <p>2.奖励保障是指作品签约网站所拥有的全勤奖，节假日福利等；</p>
        <p>3.第三方渠道是指除xxxx（这里调用网站名字）平台系的外部渠道销售，包括但不限于咪咕阅读，天翼阅读，联通，百度，小米多看，搜狗，凤凰，QQ阅读等）；</p>
        <p>4.版权收入是指作品进行版权交易所产生的收入，包含简、繁体出版，游戏改编，影视剧改编，非简体汉字版授权等。</p>


        </div>

        <!--收入月报模板-->
        <textarea id="incomeListTpl" style="display:none;">
			<%each list as item index%>
			<tr>
				<td><a class="chapter titleft" href="javascript:"><%= item.booktitle %></a></td>
				<td><%= !item.showincome || parseFloat(item.showincome)<=0?'0':parseFloat(item.showincome) %></td>
				<td><%= !item.showvipegold || parseFloat(item.showvipegold)<=0?'0':parseFloat(item.showvipegold) %></td>
				<td><%= !item.othercount || parseFloat(item.othercount)<=0?'0':parseFloat(item.othercount) %></td>
				<td><%= !item.welfarecount || parseFloat(item.welfarecount)<=0?'0':parseFloat(item.welfarecount) %></td>
				<td><%= !item.channelother || parseFloat(item.channelother)<=0?'0':parseFloat(item.channelother) %></td>
				<td><%= !item.copyrightPay || parseFloat(item.copyrightPay)<=0?'0':parseFloat(item.copyrightPay) %></td>
				<td>
					<%if item.showtype == '0' %>
						<%if item.payinfo == 1 %>
							未支付
						<%else%>
							信息不全<a class="icon q_icon" href="<%= item.tmp_url%>"  title="信息不全，请点击此处填写银行账号，如无法正常填写，请联系您的签约编辑"></a>
						<%/if%>
					<%else if item.showtype == '1'%>
						已支付
					<%else%>
					    申请支付中
					<%/if%>
				</td>
				<td>
					<%=!item.totalIncome || parseFloat(item.totalIncome)<=0?'0':parseFloat(item.totalIncome)%>
				</td>
			</tr>
			<%/each%>
		</textarea>

        <!--收入月报的无数据模板-->
        <textarea id="incomeEmptyListTpl" style="display:none;">
			<tr>
				<td>$bookTitle$</td>
				<td>0</td>
				<td>0</td>
				<td>0</td>
				<td>0</td>
				<td>0</td>
				<td>0</td>
				<td>0</td>
				<td>--</td>        
				<td>0.00</td>
			</tr>
		</textarea>

        <!--超当月月份收入的无数据模板-->
        <textarea id="incomeEmptyListTplV2" style="display:none;">
			<tr>
				<td colspan="13">暂无任何数据</td>
			</tr>
		</textarea></div>
        <img id="requestLoadingTip" class="loadImg" style="display: none;" src="__PUBLIC__/writer/images/loading.gif"></div>
        <script type="text/javascript" src="__PUBLIC__/writer/js/income.js"></script><script type="text/javascript">
            $(function () {
                CS.page.income.main.init();
            });
        </script>

    </div>
    {include file="public/footer" /}

{/block}
{block name="script"}
{/block}


